package com.zhuang.designpattern.factory.optimize;

import java.util.HashMap;
import java.util.Map;

/**
 * description: Test
 * date: 2022/9/10 11:14
 * author: Zhuang
 * version: 1.0
 */
public class Test {
    public static void main(String[] args) throws Exception {
        StoreFactory factory = new StoreFactory();
        // 优惠券
        ICommodity commodityService1 = factory.getCommodityService(1);
        commodityService1.sendCommodity("10001", "EGM1023938910232121323432", "791098764902132", null);
        // 实物商品
        ICommodity commodityService2 = factory.getCommodityService(2);
        Map<String, String> extMap = new HashMap<>();
        extMap.put("consigneeUserName", "谢⻜飞机");
        extMap.put("consigneeUserPhone", "15200292123");
        extMap.put("consigneeUserAddress", "吉林林省.⻓长春市.双阳区.XX街道.檀溪苑⼩小区.#18-2109");
        commodityService2.sendCommodity("10001", "9820198721311", "1023000020112221113", extMap);

        // 第三⽅方兑换卡(爱奇艺)
        ICommodity commodityService3 = factory.getCommodityService(3);
        commodityService3.sendCommodity("10001", "AQY1xjkUodl8LO975GdfrYUio", null, null);
    }
}
